package com.lin.blog.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lin.blog.entity.Permission;
import com.lin.utils.Result;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lin
 * @since 2020-03-08
 */
public interface IPermissionService extends IService<Permission> {

    /**
     * 通过角色名获取权限
     * @param roleName
     * @return
     */
    public List<Permission> getPermissionByRoleName(String roleName);


    /**
     * 分页获取 PermissionList
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Result listPermission(Long pageNum, Long pageSize);


    /**
     * 获取 PermissionList
     * @return
     */
    public Result listPermission();


    /**
     * 通过主键ID查询Permission
     *
     * @param id
     * @return
     */
    public Result getPermission(Long id);

    /**
     * 插入一条Permission记录
     * @param permission
     * @return
     */
    public Result savePermission(Permission permission);

    /**
     * 通过主键ID删除Permission
     * @param id
     * @return
     */
    public Result removePermission(Long id);

    /**
     * 通过主键ID更新Permission
     * @param id
     * @param permission
     * @return
     */
    public Result updateTags(Long id, Permission permission);
}
